/*
 * ViewBackup.java
 *
 * Created on April 5, 2007, 4:57 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package edu.byu.isys413.actions;

import Data.*;
import java.util.List;
import javax.servlet.http.*;

/**
 *
 * @author Dallin Regehr
 */
public class ViewBackup implements edu.byu.isys413.web.Action{
    
    /** Creates a new instance of ViewBackup */
    public ViewBackup() {
    }
    
    public String process(HttpServletRequest request, HttpServletResponse response) throws Exception {
        HttpSession session = request.getSession();
        CustomerBO cust = (CustomerBO)session.getAttribute("customer");

        //get all files for this customer
        List<BackupFileBO> files = BackupFileDAO.getInstance().getAllCustBackupFiles(cust);
        //pass back the files
        request.setAttribute("backupFiles", files);
        System.out.println("about to test......");
        if(files == null) System.out.println("empty file list!");
        return "backupStuff.jsp";
    }
}
